package com.pan.test.socket.example06;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {

    public static void main(String[] args) throws IOException, InterruptedException {
        ServerSocket serverSocket = new ServerSocket(11451,0);
        Socket[] sockets = new Socket[3];
        for (int i = 0; i < 2; i++) {
            sockets[i] = serverSocket.accept();
            System.out.println(sockets[i].isConnected()&&!sockets[i].isClosed());
        }
        Thread.sleep(5000);

    }

}
